﻿Imports sonicERPinfo
Public Class TelefoneDAL
    Implements InterfaceDAL


    Public Sub New()

    End Sub

    Dim DAL As New DAL

    Public Function GetTipoTelefone(ByVal telefone As TelefoneInfo)
        Dim select_ As String = "SELECT_TIPOTELEFONE"
        Dim entidade As New ArrayList
        entidade.Add(telefone.idtelefone)
        entidade.Add(telefone.tipoTelefone)
        Dim obj As New ArrayList()
        obj.Add("idtelefone")
        obj.Add("tipoTelefone")


        Return DAL.SqlEcuteReader(select_, True, New ArrayList(), entidade, False, 2, telefone, obj, False)
    End Function

    Public Sub Delete(ByVal tabela As sonicERPinfo.Tabelainfo) Implements InterfaceDAL.Delete

    End Sub

    Public Function Getlista(ByVal tabela As sonicERPinfo.Tabelainfo) Implements InterfaceDAL.Getlista

    End Function

    Public Sub Insert(ByVal tabela As sonicERPinfo.Tabelainfo) Implements InterfaceDAL.Insert
        Try


            Dim select_ As String = "INSERT_TELEFONES"

            Dim parameter As New ArrayList
            parameter.Add("@idCliente")
            parameter.Add("@idTipoTelefone")
            parameter.Add("@Telefone")
            Dim entidade As New ArrayList
            entidade.Add(tabela.telefone.idtelefone)
            entidade.Add(tabela.telefone.idTipoTelefone)
            entidade.Add(tabela.telefone.telefone)

            DAL.SQLExecuteNonQuery(select_, True, parameter, entidade, True, True)

        Catch ex As Exception
            Throw New Exception(ex.Message)

        End Try
    End Sub

    Public Function Insert(ByVal tabela As sonicERPinfo.Tabelainfo, ByVal sobrecarga As Boolean) As Object Implements InterfaceDAL.Insert

    End Function

    Public Sub Update(ByVal tabela As sonicERPinfo.Tabelainfo) Implements InterfaceDAL.Update

    End Sub
End Class
